/*
 * Created on Feb 17, 2005
 */
package com.scalar.chiptrack.finance.openpo.actioncommands;

/**
 * @author Ravikanth
**/
import com.scalar.chiptrack.actioncommands.ActionCommand;
import com.scalar.chiptrack.commons.Constants;

public class OpenPurchaseOrderCommandFactory implements Constants
{

	private static OpenPurchaseOrderCommandFactory sPacfactory;

	public synchronized static OpenPurchaseOrderCommandFactory getInstance()
	{
		if ( sPacfactory == null )
		{
			sPacfactory = new OpenPurchaseOrderCommandFactory();
		}
		return sPacfactory;
	}

	private OpenPurchaseOrderCommandFactory()
	{
	}

	/**
	 * Returns the ActionCommand Class that implements businnes logic for the given action
	 *
	 * @param action
	 * @return
	 */
	public static ActionCommand getActionCommand( String action )
	{
		if( ACTION_NEW.equalsIgnoreCase( action ) )
		{
			return new OpenPurchaseOrderNewCommand();
		}
		if( ACTION_CONFIRM.equalsIgnoreCase( action ) )
		{
			return new OpenPurchaseOrderConfirmCommand();
		}
		if( ACTION_EDIT.equalsIgnoreCase( action ) )
		{
			return new OpenPurchaseOrderEditCommand();
		}
		if( ACTION_SAVE.equalsIgnoreCase( action ) )
		{
			return new OpenPurchaseOrderSaveCommand();
		}
		if( ACTION_VIEW.equalsIgnoreCase( action ) )
		{
			return new OpenPurchaseOrderViewCommand();
		}
		if( ACTION_UPDATE.equalsIgnoreCase( action ) )
		{
			return new OpenPurchaseOrderUpdateCommand();
		}
		if( ACTION_OPEN_PURCHASE_ORDER_RELATED_POS.equalsIgnoreCase( action ) )
		{
			return new OpenPurchaseOrderViewRelatedPOCommand();
		}
		if( ACTION_PURCHASE_ORDER_AUDIT_TRAIL.equalsIgnoreCase( action ) )
		{
			return new OpenPurchaseOrderAuditTrailCommand();
		}
        if( ACTION_PURCHASE_ORDER_PRINT_VIEW.equalsIgnoreCase( action ) )
        {
            return new OpenPurchaseOrderPrinterFriendlyCommand();
        }
        if( ACTION_PURCHASE_ORDER_OPEN_SEND_MAIL.equalsIgnoreCase( action ) )
        {
            return new OpenPurchaseOrderShowSendMailCommand();
        }
        if( ACTION_PURCHASE_ORDER_SEND_MAIL.equalsIgnoreCase( action ) )
        {
            return new OpenPurchaseOrderSendMailCommand();
        }

		/*if ( ACTION_SAVE.equalsIgnoreCase( action ) )
		{
			return new Name_SaveCommand();
		}
		if ( ACTION_EDIT.equalsIgnoreCase( action ) )
		{
			return new Name_EditCommand();
		}
		if ( ACTION_SEARCH.equalsIgnoreCase( action ) )
		{
			return new Name_SearchCommand();
		}
		if ( ACTION_CONFIRM.equalsIgnoreCase( action ) )
		{
			return new Name_ConfirmCommand();
		}
		if ( ACTION_CONFIRM_EDIT.equalsIgnoreCase( action ) )
		{
			return new Name_ConfirmEditCommand();
		}
		if ( ACTION_VIEW.equalsIgnoreCase( action ) )
		{
			return new Name_ViewCommand();
		}
		if ( ACTION_PRINTER_FRIENDLY.equalsIgnoreCase( action ) )
		{
			return new Name_PrinterFriendlyCommand();
		}
		if ( ACTION_OPEN_PURCHASING_DATE_ENTRY.equalsIgnoreCase( action ) )
		{
			return new Name_DateEntryCommand();
		}
		if ( ACTION_APPROVED.equalsIgnoreCase( action ) )
		{
			return new Name_ApprovedCommand();
		}*/
		return null;
	}
}
